#include "debug_addbook.h"
#include "ui_debug_addbook.h"
#include "bookstore.h"

using namespace bookstore;

debug_addbook::debug_addbook(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::debug_addbook) {
    ui->setupUi(this);
}

debug_addbook::~debug_addbook() {
    delete ui;
}

void debug_addbook::on_pushButton_clicked() {
    QString str = ui->lineEdit->text();
    int menu_id = str.toInt();
    QString str2 = ui->lineEdit_2->text();
    int count = str2.toInt();


    Book* book = new Book;
    book = createBook(menu_id);
    addBook(book, count);

    delete book;

}
